<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Obtaining the mysqlnd plugin API</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqlnd.plugin.mysql-proxy.html">A comparison of mysqlnd plugins with MySQL Proxy</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqlnd.plugin.architecture.html">MySQL Native Driver Plugin Architecture</a></div>
 <div class="up"><a href="mysqlnd.plugin.html">MySQL Native Driver Plugin API</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mysqlnd.plugin.obtaining" class="section">
  <h2 class="title">Obtaining the mysqlnd plugin API</h2>
  <p class="para">
   The <em>mysqlnd</em> plugin API is simply part of the MySQL
   Native Driver PHP extension, <em>ext/mysqlnd</em>.
   Development started on the <em>mysqlnd</em> plugin API in
   December 2009. It is developed as part of the PHP source repository,
   and as such is available to the public either via Git, or through
   source snapshot downloads.
  </p>
  <p class="para">
   The following table shows PHP versions and the corresponding
   <em>mysqlnd</em> version contained within.
  </p>
  <table class="doctable table">
   <caption><strong>The bundled mysqlnd version per PHP release</strong></caption>
   
    <thead>
     <tr>
      <th>PHP Version</th>
      <th>MySQL Native Driver version</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>5.3.0</td>
      <td>5.0.5</td>
     </tr>

     <tr>
      <td>5.3.1</td>
      <td>5.0.5</td>
     </tr>

     <tr>
      <td>5.3.2</td>
      <td>5.0.7</td>
     </tr>

     <tr>
      <td>5.3.3</td>
      <td>5.0.7</td>
     </tr>

     <tr>
      <td>5.3.4</td>
      <td>5.0.7</td>
     </tr>

    </tbody>
   
  </table>

  <p class="para">
   Plugin developers can determine the <em>mysqlnd</em>
   version through accessing <em>MYSQLND_VERSION</em>, which
   is a string of the format "<span class="quote">mysqlnd 5.0.7-dev - 091210 -
   $Revision: 300535</span>", or through
   <em>MYSQLND_VERSION_ID</em>, which is an integer such as
   50007. Developers can calculate the version number as follows:
  </p>
  <table class="doctable table">
   <caption><strong>MYSQLND_VERSION_ID calculation table</strong></caption>
   
    <thead>
     <tr>
      <th>Version (part)</th>
      <th>Example</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>Major*10000</td>
      <td>5*10000 = 50000</td>
     </tr>

     <tr>
      <td>Minor*100</td>
      <td>0*100 = 0</td>
     </tr>

     <tr>
      <td>Patch</td>
      <td>7 = 7</td>
     </tr>

     <tr>
      <td>MYSQLND_VERSION_ID</td>
      <td>50007</td>
     </tr>

    </tbody>
   
  </table>

  <p class="para">
   During development, developers should refer to the
   <em>mysqlnd</em> version number for compatibility and
   version tests, as several iterations of <em>mysqlnd</em>
   could occur during the lifetime of a PHP development branch with a
   single PHP version number.
  </p>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqlnd.plugin.mysql-proxy.html">A comparison of mysqlnd plugins with MySQL Proxy</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqlnd.plugin.architecture.html">MySQL Native Driver Plugin Architecture</a></div>
 <div class="up"><a href="mysqlnd.plugin.html">MySQL Native Driver Plugin API</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
